﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
					xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
					xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
					xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
					mc:Ignorable="d"
					xmlns:Controls="clr-namespace:Microsoft.Practices.EnterpriseLibrary.Configuration.Design.Controls">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/Microsoft.Practices.EnterpriseLibrary.Configuration.DesignTime;component/Resources/Brushes.xaml" />
        <ResourceDictionary Source="/Microsoft.Practices.EnterpriseLibrary.Configuration.DesignTime;component/Resources/Converters.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <SolidColorBrush x:Key="DisabledUpDownArrowFill" Color="#FF676767" />

    <ControlTemplate x:Key="ExpanderToggleButton"
					 TargetType="{x:Type ToggleButton}">
        <Grid>
            <Path HorizontalAlignment="Stretch"
				  x:Name="Close_Arrow"
				  VerticalAlignment="Stretch"
				  Fill="{TemplateBinding Foreground}"
				  Data="F1M11.258,1L21.65,19 0.866,19 11.258,1z"
				  RenderTransformOrigin="0.5,0.5"
				  Visibility="Collapsed"
				  Stretch="Fill"
				  Width="12"
				  Height="6">
                <Path.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform />
                        <SkewTransform />
                        <RotateTransform Angle="135" />
                        <TranslateTransform />
                    </TransformGroup>
                </Path.RenderTransform>
            </Path>
            <Path Visibility="Visible"
				  HorizontalAlignment="Stretch"
				  x:Name="Open_Arrow"
				  VerticalAlignment="Stretch"
				  Fill="{TemplateBinding Foreground}"
				  Data="F1M11.258,1L21.65,19 0.866,19 11.258,1z"
				  RenderTransformOrigin="0.5,0.5"
				  Stretch="Fill"
				  Width="12"
				  Height="6">
                <Path.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform />
                        <SkewTransform />
                        <RotateTransform Angle="90" />
                        <TranslateTransform X="0" Y="0" />
                    </TransformGroup>
                </Path.RenderTransform>
            </Path>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="IsFocused"
					 Value="True">
                <Setter Property="RenderTransform"
						TargetName="Close_Arrow">
                    <Setter.Value>
                        <TransformGroup>
                            <ScaleTransform ScaleX="1.3"
											ScaleY="1.3" />
                            <SkewTransform />
                            <RotateTransform Angle="-45" />
                            <TranslateTransform />
                        </TransformGroup>
                    </Setter.Value>
                </Setter>
                <Setter Property="RenderTransform"
						TargetName="Open_Arrow">
                    <Setter.Value>
                        <TransformGroup>
                            <ScaleTransform ScaleX="1.3"
											ScaleY="1.3" />
                            <SkewTransform />
                            <RotateTransform Angle="90" />
                            <TranslateTransform />
                        </TransformGroup>
                    </Setter.Value>
                </Setter>
            </Trigger>
            <Trigger Property="IsMouseOver"
					 Value="true">
                <Setter Property="RenderTransform"
						TargetName="Open_Arrow">
                    <Setter.Value>
                        <TransformGroup>
                            <ScaleTransform ScaleX="1.3"
											ScaleY="1.3" />
                            <SkewTransform />
                            <RotateTransform Angle="90" />
                            <TranslateTransform />
                        </TransformGroup>
                    </Setter.Value>
                </Setter>
                <Setter Property="RenderTransform"
						TargetName="Close_Arrow">
                    <Setter.Value>
                        <TransformGroup>
                            <ScaleTransform ScaleX="1.3"
											ScaleY="1.3" />
                            <SkewTransform />
                            <RotateTransform Angle="135" />
                            <TranslateTransform />
                        </TransformGroup>
                    </Setter.Value>
                </Setter>
            </Trigger>
            <Trigger Property="IsPressed"
					 Value="true" />
            <Trigger Property="IsChecked"
					 Value="true">
                <Setter Property="Visibility"
						TargetName="Close_Arrow"
						Value="Visible" />
                <Setter Property="Visibility"
						TargetName="Open_Arrow"
						Value="Collapsed" />
                <Setter Property="RenderTransform" TargetName="Close_Arrow">
                    <Setter.Value>
                        <TransformGroup>
                            <ScaleTransform/>
                            <SkewTransform/>
                            <RotateTransform Angle="135"/>
                            <TranslateTransform/>
                        </TransformGroup>
                    </Setter.Value>
                </Setter>
            </Trigger>
            <Trigger Property="IsEnabled"
					 Value="False">
                <Setter Property="Fill" TargetName="Open_Arrow" Value="Gray"/>
                <Setter Property="Fill" TargetName="Close_Arrow" Value="Gray"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <Style x:Key="SectionExpander"
		   TargetType="{x:Type Expander}">
        
        <Setter Property="AutomationProperties.AutomationId"
                Value="{Binding Name}" />        
        <Setter Property="Background"
				Value="{DynamicResource LightBrush}" />
        <Setter Property="BorderBrush"
				Value="{DynamicResource NormalBorderBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Expander}">
                    <Grid Margin="0,0,0,10"
						  d:DesignWidth="191.25">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto"
										   x:Name="PropertyGridRow" />
                            <RowDefinition Height="*"
										   x:Name="ContentRow" />
                        </Grid.RowDefinitions>
                        <Border Background="#FFBDBDBD"
							BorderBrush="{DynamicResource LightGreyBorderBrush}"
							BorderThickness="1"
							HorizontalAlignment="Left">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="20" />
                                    <ColumnDefinition MinWidth="160"/>
                                    <ColumnDefinition Width="20" />
                                </Grid.ColumnDefinitions>
                                <ToggleButton Template="{DynamicResource ExpanderToggleButton}"
                                    x:Name="expanderToggle"
                                    Focusable="False"
									Background="{DynamicResource NormalBrush}"
									IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                                    Visibility="{Binding Bindable, Mode=OneWay, Converter={StaticResource NullToHiddenConverter}}"
									OverridesDefaultStyle="True" />
                                <ContentPresenter Grid.Column="1"
									Margin="4"
									RecognizesAccessKey="True"
									ContentSource="Header" />
                                <StackPanel Orientation="Horizontal" Grid.Column="2" Focusable="False">
                                    <ToggleButton Content="Properties"
                                        Focusable="False"
									    x:Name="ShowProperties"
									    Template="{DynamicResource PropertiesExpandToggleButton}"
									    Background="{DynamicResource NormalBrush}"
                                        VerticalAlignment="Center"
                                        Margin="1,0,1,0"
                                        IsChecked="{Binding PropertiesShown, Mode=TwoWay}"
									    Visibility="{Binding Properties, Converter={StaticResource PropertiesToVisibilityConverter}, FallbackValue=Hidden}" />
                                </StackPanel>
                            </Grid>
                        </Border>
                        <Border
							BorderBrush="{DynamicResource LightGreyBorderBrush}"
							BorderThickness="1" HorizontalAlignment="Stretch" Grid.RowSpan="3" Margin="0,20,0,0"
                            Visibility="{Binding IsChecked, Converter={StaticResource BooleanToHiddenConverter}, ElementName=expanderToggle}" />

                        <Border Grid.Row="1"
								Background="{StaticResource PopupBackground}"
								BorderBrush="{StaticResource LightGreyBorderBrush}"
								BorderThickness="1"
								MaxWidth="600"
								HorizontalAlignment="Left"
								Padding="5"
								Visibility="{Binding IsChecked, Converter={StaticResource BooleanToVisibilityConverter}, ElementName=ShowProperties}">
                            <ItemsControl Focusable="False" ItemsSource="{Binding Properties}" Grid.IsSharedSizeScope="True">
                                <ItemsControl.Template>
                                    <ControlTemplate>
                                        <Grid HorizontalAlignment="Stretch"
                                              Controls:GridSplitterKeyAccelerator.TargetColumn="1"
                                              Controls:GridSplitterKeyAccelerator.DecrementKeyGesture="Alt+Left"
                                              Controls:GridSplitterKeyAccelerator.IncrementKeyGesture="Alt+Right">                                              
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="12" />
                                                <ColumnDefinition Width="75" SharedSizeGroup="PropLabel"/>
                                                <ColumnDefinition Width="175*" />
                                            </Grid.ColumnDefinitions>

                                            <GridSplitter Focusable="False"
                                                          Grid.Column="1" 
                                                          HorizontalAlignment="Right" 
                                                          Width="2"
                                                          ResizeDirection="Columns" 
                                                          ShowsPreview="False" />

                                            <VirtualizingStackPanel 
                                                Grid.ColumnSpan="3"
                                                IsItemsHost="True" />
                                            
                                        </Grid>
                                    </ControlTemplate>
                                </ItemsControl.Template>
                            </ItemsControl>
                        </Border>

                        <Border Visibility="Collapsed"
							Grid.Row="2"
							x:Name="ExpandSite"
							Background="{DynamicResource WindowBackgroundBrush}"
							BorderBrush="{DynamicResource SolidBorderBrush}"
							BorderThickness="1,0,1,1"
							CornerRadius="0,0,2,2"
							Padding="5">
                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
								Margin="{TemplateBinding Padding}"
								VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsExpanded"
								 Value="True">
                            <Setter Property="Visibility"
									Value="Visible"
									TargetName="ExpandSite" />
                        </Trigger>
                        <Trigger Property="IsEnabled"
								 Value="False">
                            <Setter Property="Foreground"
									Value="{DynamicResource DisabledForegroundBrush}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="NoBoxFocusVisualStyle"
		   TargetType="{x:Type Control}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Control}">
                    <Grid />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <ControlTemplate x:Key="PropertiesExpandToggleButton"
					 TargetType="{x:Type ToggleButton}">
        <ContentControl Focusable="False"  x:Name="propertiesButtonVisual" Foreground="{DynamicResource ElementCommandNormalBrush}" Background="{DynamicResource ElementCommandBackgroundBrush}" >
            <Canvas x:Name="chevronVisual" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="17" Height="17">
                <Canvas.RenderTransform>
                    <RotateTransform Angle="180" CenterX="8.5" CenterY="8.5" />
                </Canvas.RenderTransform>
                <Path Width="18" Height="18" Canvas.Left="-0.5" Canvas.Top="-0.499999" Stretch="Fill" StrokeLineJoin="Round" Stroke="#00949494" Fill="{Binding Background, ElementName=propertiesButtonVisual}" Data="F1 M 3,9.53674e-007L 14,9.53674e-007C 15.6569,9.53674e-007 17,1.34315 17,3L 17,14C 17,15.6569 15.6569,17 14,17L 3,17C 1.34315,17 -1.63975e-007,15.6569 -1.63975e-007,14L -1.63975e-007,3C -1.63975e-007,1.34315 1.34315,9.53674e-007 3,9.53674e-007 Z "/>
                <Path Width="18" Height="18" Canvas.Left="-0.5" Canvas.Top="-0.499999" Stretch="Fill" StrokeLineJoin="Round" Stroke="{DynamicResource ElementCommandNormalBrush}" Data="F1 M 3,9.53674e-007L 14,9.53674e-007C 15.6569,9.53674e-007 17,1.34315 17,3L 17,14C 17,15.6569 15.6569,17 14,17L 3,17C 1.34315,17 -1.63975e-007,15.6569 -1.63975e-007,14L -1.63975e-007,3C -1.63975e-007,1.34315 1.34315,9.53674e-007 3,9.53674e-007 Z "/>

                <Viewbox Width="11.3482" Height="13.47" Canvas.Left="2.82593" Canvas.Top="1.76501">
                    <Canvas Width="11.3482" Height="13.47">
                        <Viewbox Width="11.3482" Height="13.47" Canvas.Left="0" Canvas.Top="0">
                            <Canvas Width="11.3482" Height="13.47">
                                <Path Width="11.3482" Height="7.17429" Canvas.Left="-7.15256e-007" Canvas.Top="0" Stretch="Fill" StrokeThickness="3" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeLineJoin="Round" Stroke="{DynamicResource ElementCommandShadowBrush}" Data="F1 M 9.84817,5.67429L 5.67408,1.5L 1.5,5.64842"/>
                                <Path Width="11.3482" Height="7.17429" Canvas.Left="7.15256e-007" Canvas.Top="6.29569" Stretch="Fill" StrokeThickness="3" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeLineJoin="Round" Stroke="{DynamicResource ElementCommandShadowBrush}" Data="F1 M 9.84817,11.97L 5.67408,7.79569L 1.5,11.9441"/>
                            </Canvas>
                        </Viewbox>
                        <Viewbox Width="10.3482" Height="12.47" Canvas.Left="0.499999" Canvas.Top="0.5">
                            <Canvas Width="10.3482" Height="12.47">
                                <Path Width="10.3482" Height="6.17429" Canvas.Left="-9.53674e-007" Canvas.Top="0" Stretch="Fill" StrokeThickness="2" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeLineJoin="Round" Stroke="{Binding Foreground, ElementName=propertiesButtonVisual}" Data="F1 M 9.34817,5.17429L 5.17408,1L 0.999999,5.14842"/>
                                <Path Width="10.3482" Height="6.17429" Canvas.Left="4.29153e-006" Canvas.Top="6.29569" Stretch="Fill" StrokeThickness="2" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeLineJoin="Round" Stroke="{Binding Foreground, ElementName=propertiesButtonVisual}" Data="F1 M 9.34818,11.47L 5.17409,7.29569L 1,11.4441"/>
                            </Canvas>
                        </Viewbox>
                    </Canvas>
                </Viewbox>
            </Canvas>        </ContentControl>        <ControlTemplate.Triggers>
            <Trigger Property="IsFocused" Value="True">
				<Setter Property="Foreground" TargetName="propertiesButtonVisual" Value="{DynamicResource ElementCommandMouseOverBrush}"/>
			</Trigger>
			<Trigger Property="IsMouseOver" Value="true">
				<Setter Property="Foreground" TargetName="propertiesButtonVisual" Value="{DynamicResource ElementCommandMouseOverBrush}"/>
			</Trigger>
			<Trigger Property="IsPressed"
					 Value="True" >
                <Setter TargetName="chevronVisual" Property="RenderTransform" Value="{x:Null}">
                </Setter>
			</Trigger>
			<Trigger Property="IsChecked"
					 Value="True">
                <Setter TargetName="chevronVisual" Property="RenderTransform" Value="{x:Null}">
                    </Setter>
            </Trigger>
			<Trigger Property="IsEnabled"
					 Value="False"/>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    
    <Style x:Key="ExpanderRightHeaderStyle" TargetType="{x:Type ToggleButton}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ToggleButton}">
                    <Border Padding="{TemplateBinding Padding}">
                        <Grid SnapsToDevicePixels="False" Background="Transparent">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="19"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <Grid>
                                <Grid.LayoutTransform>
                                    <TransformGroup>
                                        <TransformGroup.Children>
                                            <TransformCollection>
                                                <RotateTransform Angle="-90"/>
                                            </TransformCollection>
                                        </TransformGroup.Children>
                                    </TransformGroup>
                                </Grid.LayoutTransform>
                                <Ellipse x:Name="circle" Stroke="DarkGray" HorizontalAlignment="Center" VerticalAlignment="Center" Width="19" Height="19"/>
                                <Path x:Name="arrow" Stroke="#666" StrokeThickness="2" HorizontalAlignment="Center" VerticalAlignment="Center" SnapsToDevicePixels="false" Data="M 1,1.5 L 4.5,5 L 8,1.5"/>
                            </Grid>
                            <ContentPresenter HorizontalAlignment="Center" Margin="0,4,0,0" VerticalAlignment="Top" SnapsToDevicePixels="True" Grid.Row="1" RecognizesAccessKey="True"/>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="true">
                            <Setter Property="Data" TargetName="arrow" Value="M 1,4.5  L 4.5,1  L 8,4.5"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Stroke" TargetName="circle" Value="#FF3C7FB1"/>
                            <Setter Property="Stroke" TargetName="arrow" Value="#222"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter Property="Stroke" TargetName="circle" Value="#FF526C7B"/>
                            <Setter Property="StrokeThickness" TargetName="circle" Value="1.5"/>
                            <Setter Property="Stroke" TargetName="arrow" Value="#FF003366"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="ExpanderUpHeaderStyle" TargetType="{x:Type ToggleButton}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ToggleButton}">
                    <Border Padding="{TemplateBinding Padding}">
                        <Grid SnapsToDevicePixels="False" Background="Transparent">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="19"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <Grid>
                                <Grid.LayoutTransform>
                                    <TransformGroup>
                                        <TransformGroup.Children>
                                            <TransformCollection>
                                                <RotateTransform Angle="180"/>
                                            </TransformCollection>
                                        </TransformGroup.Children>
                                    </TransformGroup>
                                </Grid.LayoutTransform>
                                <Ellipse x:Name="circle" Stroke="DarkGray" HorizontalAlignment="Center" VerticalAlignment="Center" Width="19" Height="19"/>
                                <Path x:Name="arrow" Stroke="#666" StrokeThickness="2" HorizontalAlignment="Center" VerticalAlignment="Center" SnapsToDevicePixels="false" Data="M 1,1.5 L 4.5,5 L 8,1.5"/>
                            </Grid>
                            <ContentPresenter HorizontalAlignment="Left" Margin="4,0,0,0" VerticalAlignment="Center" SnapsToDevicePixels="True" Grid.Column="1" RecognizesAccessKey="True"/>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="true">
                            <Setter Property="Data" TargetName="arrow" Value="M 1,4.5  L 4.5,1  L 8,4.5"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Stroke" TargetName="circle" Value="#FF3C7FB1"/>
                            <Setter Property="Stroke" TargetName="arrow" Value="#222"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter Property="Stroke" TargetName="circle" Value="#FF526C7B"/>
                            <Setter Property="StrokeThickness" TargetName="circle" Value="1.5"/>
                            <Setter Property="Stroke" TargetName="arrow" Value="#FF003366"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="ExpanderLeftHeaderStyle" TargetType="{x:Type ToggleButton}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ToggleButton}">
                    <Border Padding="{TemplateBinding Padding}">
                        <Grid SnapsToDevicePixels="False" Background="Transparent">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="19"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <Grid>
                                <Grid.LayoutTransform>
                                    <TransformGroup>
                                        <TransformGroup.Children>
                                            <TransformCollection>
                                                <RotateTransform Angle="90"/>
                                            </TransformCollection>
                                        </TransformGroup.Children>
                                    </TransformGroup>
                                </Grid.LayoutTransform>
                                <Ellipse x:Name="circle" Stroke="DarkGray" HorizontalAlignment="Center" VerticalAlignment="Center" Width="19" Height="19"/>
                                <Path x:Name="arrow" Stroke="#666" StrokeThickness="2" HorizontalAlignment="Center" VerticalAlignment="Center" SnapsToDevicePixels="false" Data="M 1,1.5 L 4.5,5 L 8,1.5"/>
                            </Grid>
                            <ContentPresenter HorizontalAlignment="Center" Margin="0,4,0,0" VerticalAlignment="Top" SnapsToDevicePixels="True" Grid.Row="1" RecognizesAccessKey="True"/>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="true">
                            <Setter Property="Data" TargetName="arrow" Value="M 1,4.5  L 4.5,1  L 8,4.5"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Stroke" TargetName="circle" Value="#FF3C7FB1"/>
                            <Setter Property="Stroke" TargetName="arrow" Value="#222"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter Property="Stroke" TargetName="circle" Value="#FF526C7B"/>
                            <Setter Property="StrokeThickness" TargetName="circle" Value="1.5"/>
                            <Setter Property="Stroke" TargetName="arrow" Value="#FF003366"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="ExpanderHeaderFocusVisual">
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate>
                    <Border>
                        <Rectangle Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" Margin="0" SnapsToDevicePixels="true"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="ExpanderDownHeaderStyle" TargetType="{x:Type ToggleButton}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ToggleButton}">
                    <Border Padding="{TemplateBinding Padding}">
                        <Grid SnapsToDevicePixels="False" Background="Transparent">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Ellipse x:Name="circle" Stroke="DarkGray" HorizontalAlignment="Center" VerticalAlignment="Center" Width="19" Height="19" Grid.Column="1"/>
                            <Path x:Name="arrow" Stroke="#666" StrokeThickness="2" HorizontalAlignment="Center" VerticalAlignment="Center" SnapsToDevicePixels="false" Data="M 1,1.5 L 4.5,5 L 8,1.5" Grid.Column="1"/>
                            <ContentPresenter HorizontalAlignment="Left" Margin="4,0,0,0" VerticalAlignment="Center" SnapsToDevicePixels="True" Grid.Column="0" RecognizesAccessKey="True"/>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="true">
                            <Setter Property="Data" TargetName="arrow" Value="M 1,4.5  L 4.5,1  L 8,4.5"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Stroke" TargetName="circle" Value="#FF3C7FB1"/>
                            <Setter Property="Stroke" TargetName="arrow" Value="#222"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter Property="Stroke" TargetName="circle" Value="#FF526C7B"/>
                            <Setter Property="StrokeThickness" TargetName="circle" Value="1.5"/>
                            <Setter Property="Stroke" TargetName="arrow" Value="#FF003366"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="DropDownEditorExpander" TargetType="{x:Type Expander}">
        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Expander}">
                    <Border SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3">
                        <DockPanel>
                            <ToggleButton x:Name="HeaderSite" FocusVisualStyle="{StaticResource ExpanderHeaderFocusVisual}" Margin="1" MinHeight="0" MinWidth="0" Style="{StaticResource ExpanderDownHeaderStyle}" Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}" ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" FontStretch="{TemplateBinding FontStretch}" FontStyle="{TemplateBinding FontStyle}" FontWeight="{TemplateBinding FontWeight}" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" DockPanel.Dock="Top"/>
                            <ContentPresenter x:Name="ExpandSite" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Focusable="false" Visibility="Collapsed" DockPanel.Dock="Bottom"/>
                        </DockPanel>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsExpanded" Value="true">
                            <Setter Property="Visibility" TargetName="ExpandSite" Value="Visible"/>
                        </Trigger>
                        <Trigger Property="ExpandDirection" Value="Right">
                            <Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Right"/>
                            <Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Left"/>
                            <Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource ExpanderRightHeaderStyle}"/>
                        </Trigger>
                        <Trigger Property="ExpandDirection" Value="Up">
                            <Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Top"/>
                            <Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Bottom"/>
                            <Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource ExpanderUpHeaderStyle}"/>
                        </Trigger>
                        <Trigger Property="ExpandDirection" Value="Left">
                            <Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Left"/>
                            <Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Right"/>
                            <Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource ExpanderLeftHeaderStyle}"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>